Skip to content

refactor: validate external adapter boundaries with zod#20

Merged
dianfishekqi merged 2 commits into
mainfrom
refactor/typed-adapter-boundaries
Jul 21, 2026
Merged

refactor: validate external adapter boundaries with zod#20
dianfishekqi merged 2 commits into
mainfrom
refactor/typed-adapter-boundaries

Conversation

@kastriotkastrati

Copy link
Copy Markdown
Contributor

No description provided.

kastriotkastrati and others added 2 commits July 21, 2026 16:46
Parse and validate LLM, Slack, and GitHub adapter responses at the door
with zod, so downstream code consumes typed values instead of narrowing
`unknown` with `as`.

- github: lenient looseObject schemas for GraphQL nodes (graphql-schema.ts);
  ghGraphQL/ghRest take a schema and return Result<z.infer<S>>; normalize,
  discover-links, adapter, and auth consume typed nodes — drops the
  Record<string, unknown> threading and the boundary casts.
- slack: schemas for Web API replies in adapter.ts + identity.ts.
- llm: workersAiResponseSchema in extractText.

Parse failure -> Result.Err (or undefined where a Platform port demands it).
Schemas declare only consumed fields + passthrough, tolerant of upstream
additions.
@dianfishekqi
dianfishekqi force-pushed the refactor/typed-adapter-boundaries branch from 087e62b to b708a54 Compare July 21, 2026 14:52
@dianfishekqi
dianfishekqi merged commit ec226c9 into main Jul 21, 2026
1 check passed
@dianfishekqi
dianfishekqi deleted the refactor/typed-adapter-boundaries branch July 21, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants